using NHibernate;
using NhibernateDemoCore;

namespace NhibernateDemoConsole
{
    internal class LoadCustomer
    {
        public void Execute(ISessionFactory factory)
        {
            using (var session = factory.OpenSession())
            using (var tx = session.BeginTransaction())
            {
                try
                {
                    session.Load<Customer>(101L);
                    tx.Commit();
                }
                catch
                {
                    tx.Rollback();
                    throw;
                }
            }
        }
    }
}